/**
 * 
 */
package com.aodesoft.demo.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.aodesoft.demo.dao.DemoSNSDao;
import com.aodesoft.demo.dao.DemoSNSReplayDao;
import com.aodesoft.pojo.DemoReplay;
import com.aodesoft.pojo.DemoSns;
import com.googlecode.genericdao.search.Search;

/**
 * 
 * @author tang
 * @date 2011-12-4
 */
@Service
public class DemoSNSService {
	@Resource(name="demoSNSDao")
	DemoSNSDao snsdao;
	@Resource(name="demoSNSReplayDao")
	DemoSNSReplayDao snsreplaydao;
	
	
	
	public void add(DemoSns d){
		snsdao.save(d);
	}
	public void addReplay(DemoReplay dr){
		snsreplaydao.save(dr);
	}
	
	public List<DemoSns> getSNS(){
		return snsdao.findAll();
	} 
	public Boolean delSNS(int id){
		return snsdao.removeById(id);
	}
	public Boolean delSNpSReplay(int id){
		//snsreplaydao.removeById(id);
		snsreplaydao.remove(new DemoReplay(id));
		return true;
	}
}
